#include <iostream>
#include <chrono>
#include <thread>

using namespace std;

void th_function1()  
{  
    std::cout << "hello thread1." << std::endl;  
}  

void th_function2()  
{  
    std::cout << "hello thread2." << std::endl;  
}  

int main(){

	std::chrono::system_clock::time_point t1, t2;
	t1 = std::chrono::system_clock::now();
	thread th1(th_function1);
	thread th2(th_function2);
	th1.join();
	th2.join();
	t2 = std::chrono::system_clock::now();
	cout<<std::chrono::duration_cast<std::chrono::microseconds>( t2-t1 ).count()<<std::endl;

	return 0;
}
